/**
 * Copyright (C), 2015-2019, XXX有限公司
 * FileName: StrategyClient
 * Author:   zhouheng
 * Date:     2019/5/1 20:52
 * Description: 策略模式客户端程序
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.zhouh.patterns.com.zhouh.action.strategy;

import java.util.HashMap;
import java.util.Map;

/**
 * 〈一句话功能简述〉<br> 
 * 〈策略模式客户端程序〉
 *
 * @author zhouheng
 * @create 2019/5/1
 * @since 1.0.0
 */
public class StrategyClient {
    public static Map<String, Discount> map = new HashMap<>();

    static {
        map.put("老顾客优惠价: ", new OldCustomerDiscount());
        map.put("第二件优惠价: ", new SecondDiscount());
        map.put("满减优惠价: ", new FullDiscount());
        map.put("首次购买优惠价: ", new NewerDiscount());
    }

    public static void main(String[] args){
        System.out.println("不打折价格 : " + 300);
        for (Map.Entry<String,Discount> entry : map.entrySet()){
            System.out.println(entry.getKey());
            System.out.println(entry.getValue().calculate(300));
        }
    }

}